Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"parserOptions": {
"ecmaVersion": 2020,
"babelOptions": {
"plugins": [
["@babel/plugin-syntax-import-attributes", { "deprecatedAssertSyntax": true }]
]
"plugins": [["@babel/plugin-syntax-import-attributes", { "deprecatedAssertSyntax": true }]]
}
},
"plugins": ["flowtype", "import", "prettier", "jest"],
Expand All @@ -30,11 +28,18 @@
"node/no-unsupported-features/es-syntax": "off",
"prettier/prettier": "error",
"import/no-cycle": "error",
"import/no-named-as-default": "off",
"import/no-unresolved": [
"warn",
"error",
{
"ignore": ["web3"]
"ignore": ["^@goodwidget/core/viemFallbackClient$"]
}
],
"node/no-missing-import": [
"error",
{
"allowModules": ["@goodwidget/core"]
}
]
}
}
}
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ We use
[![Build Status](https://travis-ci.com/GoodDollar/GoodServer.svg?branch=master)](https://travis-ci.com/GoodDollar/GoodServer)
[![Coverage Status](https://coveralls.io/repos/github/GoodDollar/GoodServer/badge.svg?branch=master)](https://coveralls.io/github/GoodDollar/GoodServer?branch=master)

Setup
--
## Setup

- copy env.example to .env
- choose network kovan/truffle (see below how to setup local truffle node)
- fill the mnemonic that was used to deploy contracts

Local Node
--
## Blockchain Clients

- Admin wallets use viem clients from `@goodwidget/core/viemFallbackClient`.
- Configured comma-separated HTTP RPCs are tried first, followed by Chainlist RPCs. RPC discovery is cached in memory; background endpoint ranking is disabled.
- Local HTTP nodes and configured WebSocket connections use explicit viem transports.
- Use `wallet.publicClient` for RPC reads, `contract.read.method([args])` for contract reads, and `wallet.contractTransaction(contract, 'method', [args])` with `wallet.sendTransaction(...)` for queued writes. KMS signing remains supported.
- Wallet transaction receipts retain boolean `status` and numeric `blockNumber`; direct viem results use bigint quantities and `success`/`reverted` statuses.
- Run isolated wallet tests with `npx jest src/server/blockchain/__tests__/viemWallet.test.js --runInBand --config '{"testEnvironment":"node","transform":{"^.+\\.js$":"babel-jest"}}'`.

## Local Node

- clone @gooddollar/goodcontracts
- run `truffle develop`
- in console type `migrate --reset`
Loading
Loading