-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from Web3-API/prealpha-dev
Prep 0.0.1-prealpha.7 Release
- Loading branch information
Showing
98 changed files
with
2,534 additions
and
1,016 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.1-prealpha.6 | ||
0.0.1-prealpha.7 |
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
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Console Web3API | ||
|
||
Calls log on logger plugin at uri `w3://w3/logger`. Default logger logs to console, but can be overridden with redirect to custom logger web3api implementation. | ||
|
||
### Log levels | ||
|
||
- DEBUG | ||
- INFO | ||
- WARN | ||
- ERROR | ||
|
||
## Example | ||
|
||
### Usage | ||
|
||
In schema: | ||
```graph | ||
#import { Query } into Console from "w3://ens/console.eth" | ||
type Query { | ||
customMethod(): Boolean! | ||
} | ||
``` | ||
|
||
In code: | ||
|
||
```ts | ||
import { Console_Query } from "./w3"; | ||
|
||
function customMethod(): bool { | ||
Console_Query.info("some useful info about my API"); | ||
|
||
return true; | ||
} | ||
``` | ||
### How To Run | ||
|
||
### 1. Setup Test Env | ||
|
||
``` | ||
yarn run test:env:up | ||
``` | ||
|
||
### 2. Build & Deploy The Web3API | ||
|
||
``` | ||
yarn run build | ||
yarn run deploy | ||
``` | ||
|
||
### 3. Test The Web3API Using A Query Recipe | ||
|
||
``` | ||
npx w3 query ./recipes/e2e.json | ||
``` |
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,19 @@ | ||
{ | ||
"name": "@web3api/console", | ||
"description": "Web3API for logging", | ||
"private": true, | ||
"version": "0.0.1-prealpha.6", | ||
"scripts": { | ||
"build": "w3 build", | ||
"deploy": "w3 build --ipfs http://127.0.0.1:5001 --test-ens console.eth", | ||
"test": "w3 query ./recipes/e2e.json", | ||
"test:ci": "yarn test:env:up && yarn deploy && yarn test && yarn test:env:down", | ||
"test:env:up": "w3 test-env up", | ||
"test:env:down": "w3 test-env down" | ||
}, | ||
"devDependencies": { | ||
"@web3api/cli": "0.0.1-prealpha.6", | ||
"@web3api/wasm-as": "0.0.1-prealpha.6", | ||
"js-yaml": "3.14.0" | ||
} | ||
} |
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,3 @@ | ||
{ | ||
"message": "Test message" | ||
} |
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,10 @@ | ||
[ | ||
{ | ||
"api": "ens/console.eth", | ||
"constants": "./constants.json" | ||
}, | ||
{ | ||
"query": "./log.graphql", | ||
"variables": { "message": "$message" } | ||
} | ||
] |
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,17 @@ | ||
query Log($message: String!) { | ||
error( | ||
message: $message | ||
) | ||
|
||
info( | ||
message: $message | ||
) | ||
|
||
debug( | ||
message: $message | ||
) | ||
|
||
warn( | ||
message: $message | ||
) | ||
} |
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,29 @@ | ||
import { Input_info, Logger_Query, Logger_LogLevel } from "./w3"; | ||
|
||
export function debug(input: Input_info): bool { | ||
return Logger_Query.log({ | ||
message: input.message, | ||
level: Logger_LogLevel.DEBUG | ||
}); | ||
} | ||
|
||
export function info(input: Input_info): bool { | ||
return Logger_Query.log({ | ||
message: input.message, | ||
level: Logger_LogLevel.INFO | ||
}); | ||
} | ||
|
||
export function warn(input: Input_info): bool { | ||
return Logger_Query.log({ | ||
message: input.message, | ||
level: Logger_LogLevel.WARN | ||
}); | ||
} | ||
|
||
export function error(input: Input_info): bool { | ||
return Logger_Query.log({ | ||
message: input.message, | ||
level: Logger_LogLevel.ERROR | ||
}); | ||
} |
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,19 @@ | ||
#import { Query, LogLevel } into Logger from "w3://w3/logger" | ||
|
||
type Query { | ||
debug( | ||
message: String! | ||
): Boolean! | ||
|
||
info( | ||
message: String! | ||
): Boolean! | ||
|
||
warn( | ||
message: String! | ||
): Boolean! | ||
|
||
error( | ||
message: String! | ||
): Boolean! | ||
} |
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,12 @@ | ||
description: Console log Web3Api | ||
repository: https://github.com/web3-api/monorepo | ||
format: 0.0.1-prealpha.1 | ||
query: | ||
schema: | ||
file: ./src/query/schema.graphql | ||
module: | ||
language: wasm/assemblyscript | ||
file: ./src/query/index.ts | ||
import_redirects: | ||
- uri: w3://w3/logger | ||
schema: ../../core-apis/logger/schema.graphql |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"SimpleStorageAddr": "0x4bf749ec68270027C5910220CEAB30Cc284c7BA2" | ||
"SimpleStorageAddr": "0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab" | ||
} |
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
Oops, something went wrong.