-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/hypersign-protocol/hid-node
- Loading branch information
Showing
160 changed files
with
19,461 additions
and
9,713 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ env: | |
|
||
before: | ||
hooks: | ||
- go mod tidy -compat=1.18 | ||
- go mod tidy -compat=1.19 | ||
|
||
builds: | ||
- id: ubuntu-amd64 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.18 | ||
FROM golang:1.20 | ||
|
||
# Set up dependencies | ||
ENV PACKAGES curl make git libc-dev bash gcc python3 jq | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,51 +21,48 @@ The Hypersign Identity Network is a permissionless blockchain network to manage | |
|
||
Following are the prerequisites that needs to be installed: | ||
|
||
- Golang (Installation Guide: https://go.dev/doc/install) (version: 1.18+) | ||
- Golang (Installation Guide: https://go.dev/doc/install) (version: 1.20) | ||
- make | ||
- jq | ||
|
||
## Get started | ||
|
||
### Local | ||
### Local Binary | ||
|
||
Clone the repository and install the binary: | ||
|
||
```sh | ||
git clone https://github.com/hypersign-protocol/hid-node.git | ||
cd hid-node | ||
make install | ||
``` | ||
|
||
The binary `hid-noded` will be generated in `$GO_PATH/bin` directory. To explore its functionalities, type `hid-noded --help` in a seperate terminal window. | ||
|
||
#### Running the Blockchain | ||
|
||
To start a single-node blockchain, run the following command to initialize the node: | ||
|
||
```sh | ||
sh ./scripts/localnet-single-node/setup.sh | ||
``` | ||
1. Clone this repository and install the binary: | ||
```sh | ||
git clone https://github.com/hypersign-protocol/hid-node.git | ||
cd hid-node | ||
make install | ||
``` | ||
|
||
> Note: The above script requires `jq` to be installed. | ||
> The binary `hid-noded` is usually generated in `$HOME/go/bin` directory. Run `hid-noded --help` to explore its functionalities | ||
Run the hid-node: | ||
2. Run the following script to setup a single-node blockchain. Please note that the following script requires `jq` to be installed. | ||
```sh | ||
bash ./scripts/localnet-single-node/setup.sh | ||
``` | ||
|
||
```sh | ||
hid-noded start --home ~/.hid-node | ||
``` | ||
3. Start `hid-noded`: | ||
```sh | ||
hid-noded start | ||
``` | ||
|
||
### Docker | ||
|
||
To run a single node `hid-node` docker container, run the following: | ||
To run a single node `hid-node` docker container, follow the below steps: | ||
|
||
1. Pull the image: | ||
```sh | ||
docker pull ghcr.io/hypersign-protocol/hid-node:latest | ||
``` | ||
|
||
2. Open a separate terminal window. Run the node: | ||
2. Run the following: | ||
```sh | ||
docker run -it ghcr.io/hypersign-protocol/hid-node start | ||
docker run --rm -d \ | ||
-p 26657:26657 -p 1317:1317 -p 26656:26656 -p 9090:9090 \ | ||
--name hid-node-container \ | ||
ghcr.io/hypersign-protocol/hid-node start | ||
``` | ||
|
||
## Documentation | ||
|
@@ -76,3 +73,5 @@ To run a single node `hid-node` docker container, run the following: | |
| Credential Schema | https://docs.hypersign.id/self-sovereign-identity-ssi/schema | | ||
| Verifiable Credential Status | https://docs.hypersign.id/self-sovereign-identity-ssi/verifiable-credential-vc/credential-revocation-registry | | ||
|
||
|
||
Please contact [[email protected]](mailto:[email protected]) for consulting and integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package app | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/x/auth/ante" | ||
"github.com/cosmos/ibc-go/v4/modules/core/keeper" | ||
|
||
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" | ||
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | ||
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" | ||
ssiante "github.com/hypersign-protocol/hid-node/x/ssi/ante" | ||
) | ||
|
||
// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC | ||
// channel keeper. | ||
type HandlerOptions struct { | ||
ante.HandlerOptions | ||
|
||
IBCKeeper *keeper.Keeper | ||
WasmConfig *wasmTypes.WasmConfig | ||
TXCounterStoreKey sdk.StoreKey | ||
SsiKeeper ssiante.SsiKeeper | ||
} | ||
|
||
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { | ||
if options.AccountKeeper == nil { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") | ||
} | ||
if options.BankKeeper == nil { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") | ||
} | ||
if options.SignModeHandler == nil { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") | ||
} | ||
if options.WasmConfig == nil { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder") | ||
} | ||
if options.TXCounterStoreKey == nil { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder") | ||
} | ||
if options.SsiKeeper == nil { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "ssi keeper is required for ante builder") | ||
} | ||
|
||
sigGasConsumer := options.SigGasConsumer | ||
if sigGasConsumer == nil { | ||
sigGasConsumer = ante.DefaultSigVerificationGasConsumer | ||
} | ||
|
||
anteDecorators := []sdk.AnteDecorator{ | ||
ante.NewSetUpContextDecorator(), | ||
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early | ||
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey), | ||
ante.NewRejectExtensionOptionsDecorator(), | ||
ssiante.NewSSITxDecorator(), // SSITxDecorator MUST always be called before MempoolFeeDecorator | ||
ssiante.NewMempoolFeeDecorator(), // MempoolFeeDecorator MUST always be called before DeductFeeDecorator | ||
ante.NewValidateBasicDecorator(), | ||
ante.NewTxTimeoutHeightDecorator(), | ||
ante.NewValidateMemoDecorator(options.AccountKeeper), | ||
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), | ||
ssiante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.SsiKeeper), | ||
ante.NewSetPubKeyDecorator(options.AccountKeeper), | ||
ante.NewValidateSigCountDecorator(options.AccountKeeper), | ||
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer), | ||
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), | ||
ante.NewIncrementSequenceDecorator(options.AccountKeeper), | ||
ibcante.NewAnteDecorator(options.IBCKeeper), | ||
} | ||
|
||
return sdk.ChainAnteDecorators(anteDecorators...), nil | ||
} |
Oops, something went wrong.