Skip to content

Commit

Permalink
Merge branch 'development' into development-contracts-billing-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed Aug 26, 2024
2 parents 2df78b4 + 2f06d6f commit bfbe519
Show file tree
Hide file tree
Showing 42 changed files with 763 additions and 322 deletions.
2 changes: 1 addition & 1 deletion clients/tfchain-client-go/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ func (s *Substrate) checkForError(callResponse *CallResponse) error {
if int(errIndex) >= len(moduleErrors[e.DispatchError.ModuleError.Index]) || moduleErrors[e.DispatchError.ModuleError.Index] == nil {
return fmt.Errorf("module error (%d) with unknown code %d occured, please update the module error list", e.DispatchError.ModuleError.Index, e.DispatchError.ModuleError.Error)
}
return fmt.Errorf("%v", moduleErrors[e.DispatchError.ModuleError.Index][errIndex])
return errors.New(moduleErrors[e.DispatchError.ModuleError.Index][errIndex])
} else {
return fmt.Errorf("unknown module error (%d) with code %d occured, please create the module error list", e.DispatchError.ModuleError.Index, e.DispatchError.ModuleError.Error)
}
Expand Down
10 changes: 7 additions & 3 deletions docs/development/fork-off-substrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,24 @@ Before you start, you need to have the following items:
```bash
cp ../../substrate-node/target/debug/wbuild/tfchain-runtime/tfchain_runtime.compact.wasm ./data/runtime.wasm
```
* Run a full node for your blockchain locally (Recommended but should be fully synced) or have an external endpoint handy (but should be running with `--rpc-methods Unsafe` flag)
* Run a full node for your blockchain locally (Recommended but should be fully synced) or have an external endpoint handy (but should be running with `--rpc-methods Unsafe` flag, and depending on the chain size you may need to increase the node's default `rpc-max-response-size`)
```bash
../../substrate-node/target/debug/tfchain --chain ../../substrate-node/chainspecs/dev/chainSpecRaw.json --rpc-external --rpc-methods Unsafe
```
* Run the script
* If using a local node, simply run the script using
```bash
npm start
ALICE="true" npm start
```
* If you are using an external/non-default endpoint, you need to provide it to the script via the HTTP\_RPC\_ENDPOINT environment variable
```bash
HTTP_RPC_ENDPOINT=https://<EXTERNAL END POINT> npm start
HTTP_RPC_ENDPOINT=https://<EXTERNAL END POINT> ALICE="true" npm start
```
* If you are getting `HeadersTimeoutError`, likely on the main net, set `FORK_CHUNKS_LEVEL` to 2
```bash
FORK_CHUNKS_LEVEL=2 ALICE="true" npm start
```
* You should have the genesis file for the forked chain inside the data folder. It will be called `fork.json`.
* You can now run a new chain using this genesis file
Expand Down
Loading

0 comments on commit bfbe519

Please sign in to comment.